package PatternPrinting;

import java.util.Scanner;

/**
 * Created by revathyr on 7/8/14.
 */
public class PrintDiamond {
    public static void main(String[] args) {
        PrintDiamond draw = new PrintDiamond();
        Scanner in = new Scanner(System.in);
        System.out.println("enter a number.. (the number must be odd)");
        int n = in.nextInt();
        draw.drawdiamond(n);

    }


    private void drawdiamond(int n) {
        int mid = ((n + (n - 1)) / 2) + 1;
        int count = 0;
        for (int num = 1; num <= (n + (n - 1)); num++) {

            for (int i = 1; i < (mid - count); i++) {
                System.out.print("  ");
            }
            for (int j = (mid - count); j <= (mid + count); j++) {
                System.out.print("*" + " ");
            }
            System.out.println("");
            if (num <n)
                count++;
            else
                count--;


        }

    }
}